<template>
	<view>
		<v-leaflet ref="tdleafletwx"></v-leaflet>
	</view>
</template>

<script>
    const plugin = requirePlugin('zhgeo-plugin')
	
	export default {
		data() {
			return {
				
			}
		},
		onLoad() {
			const container = this.$refs.tdleafletwx
			let min_zoom = 10
			let max_zoom = 18
			container.initLeafletMap(function(L) {
                var map = L.map(container, {
                    minZoom: min_zoom,
                    maxZoom: max_zoom,
                });
              wx.leaflet ??= {}
              wx.leaflet.L = L;
			  L.tileLayer('http://t{s}.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILECOL={x}&TILEROW={y}&TILEMATRIX={z}&tk=56b81006f361f6406d0e940d2f89a39c', { subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'] }).addTo(map)
			  
			  map.setView([31.2969292,120.6212541], 18);
			  // 添加marker
			  let m = L.marker([31.2969292,120.6212541], {
				src: 'https://cdn.bootcdn.net/ajax/libs/leaflet/1.9.4/images/marker-icon-2x.png',
				width: 32,
				height: 32,
				showInCenter: false,
			  }).addTo(map);
			  // 删除marer
			  // map.removeLayer( m );
			});
		},
		methods: {
			
		}
	}
</script>

<style>

</style>
